package vn.elca.training.important_classes_excercise;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class Question9 {
	public static void main(String[] args) {
		int value;
		System.out.println("Requirement 2: Using HashSet");
		Set<String> carPrices = new HashSet<String>();
		
		carPrices.add("BMW");
		carPrices.add("Kia-Forte");
		carPrices.add("Toyota-Camry");
		carPrices.add("Lexus");
		carPrices.add("Honda-civic");
		carPrices.add("Audi");
		System.out.println(carPrices);
		if (carPrices.contains("Audi"))
			System.out.println("Audi already have price");
		System.out.println(carPrices);
		System.out.println("Requirement 3: Using HashMap");
		
		HashMap<String, Integer> carPricesMap = new HashMap<String, Integer>();
		carPricesMap.put("BMW", 70000);
		carPricesMap.put("Kia-Forte", 29000);
		carPricesMap.put("Toyota-Camry", 60000);
		carPricesMap.put("Lexus", 90000);
		carPricesMap.put("Honda-civic", 31000);
		carPricesMap.put("Audi", 90000);
		System.out.println(carPricesMap);
		if(carPricesMap.containsKey("Audi"))
		{
			System.out.println("Audi have one more price");
			value = carPricesMap.get("Audi").intValue();
			carPricesMap.put("Audi",value++ );
		}
		System.out.println(carPricesMap);

	}

}
